package com.sx.pipeline.repos.local.db.table

import androidx.room.TypeConverter
import com.blankj.utilcode.util.GsonUtils
import com.google.gson.reflect.TypeToken

/**
 * @Author: YY
 * @Date: 2022/8/10
 * @Desc: TODO
 */
class FileNodesBeanConverter {

    @TypeConverter
    fun objectToString(list: List<FileNodesBeanDO?>?): String? {
        return GsonUtils.getGson().toJson(list)
    }

    @TypeConverter
    fun stringToObject(json: String): List<FileNodesBeanDO?>? {
        return GsonUtils.getGson().fromJson(json, object: TypeToken<List<FileNodesBeanDO>>(){}.type)
    }
}